enhance latin1 encoding test.
authortsteven4 <tsteven4@gmail.com>
Tue, 28 Nov 2017 22:57:19 +0000 (15:57 -0700)
committertsteven4 <tsteven4@gmail.com>
Tue, 28 Nov 2017 22:57:19 +0000 (15:57 -0700)
build_and_test
test_encoding [deleted file]
test_encoding_latin1 [new file with mode: 0755]

index d0ace4d0041adaa87d002a2b67332ac2744fd0c5..6e654bedc80c1eec895b5e314f3d01e418293b3e 100755 (executable)
@@ -32,7 +32,7 @@ make doc
 make gpsbabel.html
 make check
 # test for mangled encoding of command line arguments
-./test_encoding
+./test_encoding_latin1
 ./test_encoding_utf8
 #make torture
 rm -f vg.log
diff --git a/test_encoding b/test_encoding
deleted file mode 100755 (executable)
index 5a37451..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/bin/bash
-# this file should be encoded in latin1
-
-BASEPATH=`dirname $0`
-PNAME=${PNAME:-${BASEPATH}/gpsbabel}
-REFERENCE=${BASEPATH}/reference
-
-TMPDIR=${GBTEMP:-/tmp}/gpsbabel.$$
-mkdir -p $TMPDIR
-trap "rm -fr $TMPDIR" 0 1 2 3 15
-
-errorcount=0
-
-if  locale -a | grep -q en_US.iso88591 ; then
-  export LC_ALL=en_US.iso88591
-
-# test input file name mangling
-  rm -f ${TMPDIR}/test_encoding_file*
-  cp ${REFERENCE}/bounds-test.gpx ${TMPDIR}/test_encoding_file¢.gpx
-  ${PNAME} -i gpx -f ${TMPDIR}/test_encoding_file¢.gpx -o kml -F ${TMPDIR}/test_encoding_fileo.kml || {
-    echo "ERROR: The input file name was mangled."
-    errorcount=`expr $errorcount + 1`
-  }
-
-# test output file name mangling
-  rm -f ${TMPDIR}/test_encoding_file*
-  ${PNAME} -i gpx -f ${REFERENCE}/bounds-test.gpx -o kml -F ${TMPDIR}/test_encoding_file¢.kml
-  count=$(ls -1 -l ${TMPDIR}/test_encoding_file¢.kml | wc -l)
-  if [ $count -lt 1 ]; then
-    echo "ERROR: The output file name was mangled."
-    errorcount=`expr $errorcount + 1`
-  fi
-
-# test output file name mangling using a format that uses gbfile
-  rm -f ${TMPDIR}/test_encoding_file*
-  ${PNAME} -i gpx -f ${REFERENCE}/bounds-test.gpx -o unicsv -F ${TMPDIR}/test_encoding_file¢.csv
-  count=$(ls -1 -l ${TMPDIR}/test_encoding_file¢.csv | wc -l)
-  if [ $count -lt 1 ]; then
-    echo "ERROR: The output file name was mangled."
-    errorcount=`expr $errorcount + 1`
-  fi
-
-# test input file name mangling using a format that uses gbfile with the gzapi
-  rm -f ${TMPDIR}/test_encoding_file*
-  cp ${REFERENCE}/sample.gtm.gz ${TMPDIR}/test_encoding_file¢.gtm.gz
-  ${PNAME} -i gtm -f ${TMPDIR}/test_encoding_file¢.gtm.gz -o gpx -F ${TMPDIR}/test_encoding_fileo.gpx || {
-    echo "ERROR: The input file name was mangled."
-    errorcount=`expr $errorcount + 1`
-  }
-
-else
-  echo "$0 cannot run without the en_US.iso88591 locale."
-fi
-
-exit $errorcount
diff --git a/test_encoding_latin1 b/test_encoding_latin1
new file mode 100755 (executable)
index 0000000..5a37451
--- /dev/null
@@ -0,0 +1,55 @@
+#!/bin/bash
+# this file should be encoded in latin1
+
+BASEPATH=`dirname $0`
+PNAME=${PNAME:-${BASEPATH}/gpsbabel}
+REFERENCE=${BASEPATH}/reference
+
+TMPDIR=${GBTEMP:-/tmp}/gpsbabel.$$
+mkdir -p $TMPDIR
+trap "rm -fr $TMPDIR" 0 1 2 3 15
+
+errorcount=0
+
+if  locale -a | grep -q en_US.iso88591 ; then
+  export LC_ALL=en_US.iso88591
+
+# test input file name mangling
+  rm -f ${TMPDIR}/test_encoding_file*
+  cp ${REFERENCE}/bounds-test.gpx ${TMPDIR}/test_encoding_file¢.gpx
+  ${PNAME} -i gpx -f ${TMPDIR}/test_encoding_file¢.gpx -o kml -F ${TMPDIR}/test_encoding_fileo.kml || {
+    echo "ERROR: The input file name was mangled."
+    errorcount=`expr $errorcount + 1`
+  }
+
+# test output file name mangling
+  rm -f ${TMPDIR}/test_encoding_file*
+  ${PNAME} -i gpx -f ${REFERENCE}/bounds-test.gpx -o kml -F ${TMPDIR}/test_encoding_file¢.kml
+  count=$(ls -1 -l ${TMPDIR}/test_encoding_file¢.kml | wc -l)
+  if [ $count -lt 1 ]; then
+    echo "ERROR: The output file name was mangled."
+    errorcount=`expr $errorcount + 1`
+  fi
+
+# test output file name mangling using a format that uses gbfile
+  rm -f ${TMPDIR}/test_encoding_file*
+  ${PNAME} -i gpx -f ${REFERENCE}/bounds-test.gpx -o unicsv -F ${TMPDIR}/test_encoding_file¢.csv
+  count=$(ls -1 -l ${TMPDIR}/test_encoding_file¢.csv | wc -l)
+  if [ $count -lt 1 ]; then
+    echo "ERROR: The output file name was mangled."
+    errorcount=`expr $errorcount + 1`
+  fi
+
+# test input file name mangling using a format that uses gbfile with the gzapi
+  rm -f ${TMPDIR}/test_encoding_file*
+  cp ${REFERENCE}/sample.gtm.gz ${TMPDIR}/test_encoding_file¢.gtm.gz
+  ${PNAME} -i gtm -f ${TMPDIR}/test_encoding_file¢.gtm.gz -o gpx -F ${TMPDIR}/test_encoding_fileo.gpx || {
+    echo "ERROR: The input file name was mangled."
+    errorcount=`expr $errorcount + 1`
+  }
+
+else
+  echo "$0 cannot run without the en_US.iso88591 locale."
+fi
+
+exit $errorcount